'''
目标函数:
    max z=3*x1-2*x2+5*x3
约束条件:
    x1+2*x2-x3<=2
    x1+4*x2+x3<=4
    x1+x2<=3
    4*x2+x3<=6
    x1,x2,x3=0或1

其实就是暴力枚举,可以优化就优化
'''
zmax=3
x11=1
x12=0
x13=0
for x1 in range(0,2):
    for x2 in range(0,2):
        for x3 in range(0,2):
            if 3*x1-2*x2+5*x3<zmax or x1+4*x2+x3>4 or x1+x2>3 or 4*x2+x3>6:
                continue
            zmax=3*x1-2*x2+5*x3
            x11=x1
            x12=x2
            x13=x3

print(zmax)
print("x1:",x11)
print("x2:",x12)
print("x3:",x13)